#include "staffform1.h"
#include "ui_staffform1.h"
#include<QDebug>
#include"staffwindow.h"
staffForm1::staffForm1(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::staffForm1)
{
    ui->setupUi(this);
}

staffForm1::staffForm1(const QString &num, const QString &name, const double &salePrice,
                         const QString &picPath, QWidget *parent):
    QWidget(parent),
    ui(new Ui::staffForm1)
{
    ui->setupUi(this);
    ui->goodsPicLabel->setPixmap(QPixmap(picPath));
    ui->goodsPricelabel->setNum(salePrice);
    ui->goodsNaneLabel->setText(name);
    ui->goodsLabel->setText(num);


    staffWindow *p1=dynamic_cast<staffWindow *>(parent);
    connect(this,&staffForm1::Delete,p1,&staffWindow::DeleteItem);

}

staffForm1::~staffForm1()
{
    delete ui;
}

void staffForm1::on_deletButton_clicked()
{

   emit Delete(ui->goodsNaneLabel->text());

}
